$def with (ogtxml, knows, kdetail, args)
$ alllang = ['English', 'Chinese', 'Japanese']

<div role="article" class="coursera-body">
	<div class="container">
		<div class="coursera-full-canvas">
			<div class="row-fluid">
				<div class="span12">
					<div class="coursera-catalog-toolbar">
						<label for="coursera-catalog-search-id" style="display: none;">Search by knowledge name or creator</label><input
							id="contents_search" type="search"
							placeholder="Search by knowledge name or creator"
							name="search" search_cont="$(args.search)" class="coursera-catalog-search input-large search-query" value="$(args.search)">
							<input id="contents_search_btn" type="button" value="Search Knowledge" class="btn btn-large btn-primary" style=""/>
						<div class="coursera-catalog-partners">
						</div>
					</div>
				</div>
			</div>
			<div class="row-fluid">
				<div class="span3">
					<div class="coursera-catalog-sidebar">
						<div
							style="border-bottom: 1px solid #ECECEC; text-align: right; padding-top: 10px; padding-bottom: 10px; padding-right: 12px;">
							<span class="coursera-catalog-sort-title">Sorted by </span><select
								aria-label="Sort by" name="sortby"
								style="width: 150px; margin-left: 2px; margin-bottom: 0px;"
								class="coursera-catalog-sort">
								$if args.sortby == "last":
									<option value="last" selected="selected">Starting last</option>
									<option value="first">Starting first</option>
								$else:
									<option value="last">Starting last</option>
									<option value="first" selected="selected">Starting first</option>
							</select>
						</div>
						<div>
							<ul class="coursera-catalog-tag-list">
								<li class="coursera-catalog-tag coursera-catalog-tag-all"><div
										class="coursera-catalog-tag-text">All Categories</div></li>
							$for i in ogtxml.knowledges2:
								<li data-id="$i"
									class="coursera-catalog-tag coursera-catalog-tag-click "><div
										class="coursera-catalog-tag-checkbox-column">
									$if i in args.type:
										<input type="checkbox" aria-label="$i" name="knowledge2" checked="true" value="$i" class="coursera-catalog-tag-checkbox">
									$else:
										<input type="checkbox" aria-label="$i" name="knowledge2" value="$i" class="coursera-catalog-tag-checkbox">
									</div>
									<div class="coursera-catalog-tag-text">$i</div>
									<div class="coursera-catalog-tag-count"></div></li>
							</ul>
						</div>
						<div>
							<ul class="coursera-catalog-tag-list">
								<li class="coursera-catalog-tag coursera-catalog-tag-all"><div
										class="coursera-catalog-tag-text">All Languages</div></li>
							$for i in alllang:
								<li data-id="$i"
									class="coursera-catalog-tag coursera-catalog-tag-click "><div
										class="coursera-catalog-tag-checkbox-column">
										<input type="checkbox" aria-label="$i"
											class="coursera-catalog-tag-checkbox">
									</div>
									<div class="coursera-catalog-tag-text">$i</div>
									<div class="coursera-catalog-tag-count"></div></li>
							</ul>
						</div>
					</div>
				</div>
				<div class="span9">
					<div class="coursera-catalog-listings">
					$for i in knows:
						$ det = kdetail[i['idkey']]
						<div data-topic-id="$(det.id)" class="coursera-catalog-course-listing-box">
							<div class="row-fluid">
								<div class="span8">
									<div class="coursera-catalog-listing-text">
										<div class="coursera-catalog-listing-primary">
											<span class="coursera-catalog-listing-university"><a
												href="/contents?type=$(i.knowledge)"
												class="coursera-catalog-listing-secondary-link internal-home">$i.knowledge<span
													class="coursera-catalog-listing-secondary-link-target"></span>
											</a><span> </span> </span><span
												class="coursera-catalog-listing-coursename"> <a
												href="/content?type=$(i.knowledge)&kid=$(det.id)"
												class="coursera-catalog-listing-courselink internal-home">$det.Name<span
													class="coursera-catalog-listing-course-link-box"> </span> </a>
											</span><span class="coursera-catalog-listing-instructor">
												by <a href="/users?i=$det.creator"
												class="internal-home coursera-catalog-listing-secondary-link">$det.creator<span
													class="coursera-catalog-listing-secondary-link-target"></span>
											</a><span></span></span>
										</div>
									</div>
								</div>
								<div class="span2">
								</div>
								<div class="span2">
									<div class="coursera-catalog-listing-secondary">
										<span class="coursera-catalog-listing-secondary-item">$tempfuns.onlydate(det.date)</span><span
											class="coursera-catalog-listing-secondary-item"></span>
									</div>
								</div>
							</div>
						</div>
					</div>
					<div style="display: none;" class="coursera-catalog-loading-box">
						<span>Loading courses...</span>
					</div>
					<div style="display: none;" class="coursera-catalog-noresults-box">
						<span>No results.</span>
					</div>
					<div style="display: none;" class="coursera-catalog-error-box">
						<span>Error loading courses.</span>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
<script type="text/javascript">
window.onload = contents_onload;
</script>